package com.nari.system.api.factory;

import com.nari.common.core.domain.R;
import com.nari.system.api.RemoteRstLogService;
import com.nari.system.api.domain.SysRstLog;
import feign.hystrix.FallbackFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

/**
 * 日志服务降级处理
 * 
 * @author nari
 */
@Component
public class RemoteRstLogFallbackFactory implements FallbackFactory<RemoteRstLogService>
{
    private static final Logger log = LoggerFactory.getLogger(RemoteRstLogFallbackFactory.class);

    @Override
    public RemoteRstLogService create(Throwable throwable)
    {
        log.error("报文日志服务调用失败:{}", throwable.getMessage());
        return new RemoteRstLogService()
        {
            @Override
            public R<Boolean> saveRstLog(SysRstLog sysRstLog)
            {
                return null;
            }
        };

    }
}
